<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="js/jquery-1.4.1.min.js"></script>
  <script type="text/javascript" src="scripts/jquery-1.6.js"></script>
  <script type="text/javascript">
  $(document).ready(function loginEnterCheck(){       
      $("html").die().live("keydown",function(event){       
            if(event.keyCode==13){      
                //调用登陆方法;  
                login();       
             }       
      });       
});  
function login(){
		var url="uaction!userlogin.action";
		var username=$("#name").val();
		var userpaww=$("#pwd").val();
		$.ajax({
url: url,
type: "post",
dataType: "text json",
timeout: 10000,
data:{"user.userName":username,"user.userPwd":userpaww},
 error: function(XMLHttpRequest, textStatus, errorThrown) {
                        alert(textStatus);
                    },
success: function(data){
alert(data);
if(data=="登录成功！"){
	//location.href="/BCD/customer/initaction!indexinit.action";
	window.returnValue="2";
	window.close();
}else{
$("#name").val("");
$("#pwd").val("");
$("#name").focus();
}
}
});
}
  
  </script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户登录</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
  <script type="text/javascript" src="js/jquery-1.4.1.min.js"></script>
  <script type="text/javascript" src="scripts/jquery-1.6.js"></script>
<script type="text/javascript" src="js/js.js"></script>
</head>
<body>
<div id="top"> </div>
  <div id="center">
    <div id="center_left"></div>
    <div id="center_middle">
      <div class="user">
        <label>用户名：
        <input type="text" name="user.userName" id="name">
        </label>
      </div>
      <div class="user">
        <label>密　码：
        <input type="password" name="user.userPwd" id="pwd">
        </label>
      </div>
    </div>
    <div id="center_middle_right"></div>
    <div id="center_submit">
      <div class="button"> <img src="images/dl.gif" width="57" height="20" onclick="login()" > </div>
      <div class="button"> <img src="images/cz.gif" width="57" height="20" onclick="form_reset()"> </div>
    </div>
    <div id="center_right"></div>
  </div>
<div id="footer"></div>
</body>
</html>

